package com.code.base.sys.service;

import java.util.List;
import java.util.Date;
import java.util.Map;
import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.code.base.sys.persistence.SysMenuMapper;
import com.code.base.sys.pojo.SysMenu;
import com.code.util.PrimaryKeyUtil;


@Service
public class SysMenuService {


	@Resource
	private SysMenuMapper sysMenuMapper;

	public Long getInsertId() {
		return PrimaryKeyUtil.generatePrimaryKey();
	}

	public SysMenu getDataById(Long id) {
		return sysMenuMapper.getDataById(id);
	}

	public List<SysMenu> getAllData() {
		return sysMenuMapper.getAllData();
	}

	public int getDataCountByCondition(SysMenu entity) {
		return sysMenuMapper.getDataCountByCondition(entity);
	}

	public List<SysMenu> getDataByCondition(SysMenu entity) {
		return sysMenuMapper.getDataByCondition(entity);
	}

	public int getDataCountByLikeCondition(SysMenu entity) {
		return sysMenuMapper.getDataCountByLikeCondition(entity);
	}

	public List<SysMenu> getDataByLikeCondition(SysMenu entity) {
		return sysMenuMapper.getDataByLikeCondition(entity);
	}

	public List<SysMenu> getDataByIds(Long[] ids) {
		return sysMenuMapper.getDataByIds(ids);
	}

	public void insertData(SysMenu entity) {
		insertData(entity, true);
	}

	public void insertData(SysMenu entity, boolean setIdValue) {
		if (setIdValue) {
			entity.setId(getInsertId());
		}
		sysMenuMapper.insertData(entity);
	}

	public void updateData(SysMenu entity) {
		sysMenuMapper.updateData(entity);
	}

	public void updateDataByParam(Map<String, Object> map) {
		if (map.size() == 0)
			return;

		sysMenuMapper.updateDataByParam(map);
	}

	public void deleteDataByObject(SysMenu entity) {
		sysMenuMapper.deleteDataByObject(entity);
	}

	public void deleteDataById(Long id) {
		sysMenuMapper.deleteDataById(id);
	}

	public void deleteDataByIds(Long[] ids) {
		sysMenuMapper.deleteDataByIds(ids);
	}

}
